package com.cwj;

import java.util.LinkedList;
import java.util.Stack;

/**
 * @author chenwujie
 * @date 2020/10/1910:02
 */
public class StackTest {
    public static void main(String[] args) {
        LinkedList<Integer> objects = new LinkedList<>();
        char c = (char)-1;
        System.out.println(c >> 8);
        String s = "{()([()])}";
        int len = s.length();
        Stack<Character> stack = new Stack<>();
        for (int i = 0; i < len; i++) {
            char c2 = s.charAt(i);
            if (stack.isEmpty()) {
                stack.push(c2);

            } else {
                char c1 = stack.peek();
                if ((c1 ^ c2 ^ c1) == 0) {
                    stack.pop();
                } else {
                    stack.push(c2);
                }
            }
        }
        System.out.println(stack.isEmpty());
    }
}
